package com.ngc.mall.core.enumeration;

import java.util.stream.Stream;

/**
 *
 * 订单状态枚举类
 * @author: chenxiaolin
 * @date 2023/8/25 18:51
**/
public enum OrderStatus {
    ALL(0,"所有"),
    UNPAID(1,"未支付"),
    PAID(2, "已支付"),
    DELIVERED(3, "已发货"),
    FINISHED(4, "已完成"),
    CANCELED(5, "已取消"),
    AFTERSALE(6,"待售后");

    private Integer value;

    OrderStatus(int value, String description) {
        this.value=value;
    }

    public Integer getValue(){
        return this.value;
    }

    public static OrderStatus toType(int value){
        return Stream.of(OrderStatus.values()).filter(c->c.value==value).findAny().orElse(null);
    }
}
